package com.sdtv.mediunfusion.mvp.ui.outsidetask.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sdtv.mediunfusion.R;
import com.sdtv.mediunfusion.bean.SelectTopicBean;

import java.util.List;

/**
 * @ProjectName: MediunFusion
 * @Package: com.sdtv.mediunfusion.mvp.ui.outsidetask.adapter
 * @ClassName: SelectTopicAdapter
 * @Description: 我的选题 列表适配器
 * @Author: 小郭同学
 * @CreateDate: 2019-08-05 14:33
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class SelectTopicAdapter extends BaseQuickAdapter<SelectTopicBean, BaseViewHolder> {

    public SelectTopicAdapter(int layoutResId, @Nullable List<SelectTopicBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, SelectTopicBean item) {
        helper.setText(R.id.topic_titleView, item.getSelectTopicTitle())
                .setText(R.id.topic_timeView, item.getCreateTime())
                .addOnClickListener(R.id.topic_viewText);
        ImageView statusImg = helper.getView(R.id.topic_statusImg);
        switch (item.getStatus()) {
            case "0":
                statusImg.setImageResource(R.mipmap.ic_yitongduo);
                break;
            case "1":
                statusImg.setImageResource(R.mipmap.ic_daishenghe);
                break;
            case "2":
                statusImg.setImageResource(R.mipmap.ic_yibohui);
                break;
            default:
        }
    }


}
